class Solution(object):
    def thousandSeparator(self, n):
        n = str(n)
        r = len(n) // 3
        m = len(n) % 3
        if m:
            t = n[:m] + '.'
        else:
            t = ''
        for i in range(r):
            t += n[m + i * 3: m + (i + 1) * 3] + '.'
        return t[:-1]

